package fy.uap.bean;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

public class SupplierBean {

	private String providerName;

	private String providerCode;

	private String reason;

	private String similarSuppliers;

	private String address;

	private String linkman;

	private String supplyCycle;

	private String supplyAddress;

	private String tel;

	private String cvenbank;

	private String cpurbillcode;// 发票税码

	private String bankAccount;

	private String taxRegister;

	private String fax;

	private String couttype;

	private String cmoneytype;

	private String qualitySystem;

	private String postCode;

	private String companyType;

	private String ccuspaycond;

	private String property;

	private String email;

	private String ccontent;

	private JSONArray potentialSuppliers;

	private JSONArray stopSuppliers;

	private String pk_vendor;

	private JSONArray qualifiedSuppliers;

	private String cVenBankMemo;

	private String bankaccountname;
	private String bankcode;
	private String bank;
	private String bankaccount;
	private String currency;

	private String cvenfygl;
	
	private String qylb;
	private String zczj;
	private String clsj;
	private String zgrs;
	private String jycs;
	private String frdb;
	private String frdbsfz;
	private String nxse;
	

	public String getQylb() {
		return qylb;
	}

	public void setQylb(String qylb) {
		this.qylb = qylb;
	}

	public String getZczj() {
		return zczj;
	}

	public void setZczj(String zczj) {
		this.zczj = zczj;
	}

	public String getClsj() {
		return clsj;
	}

	public void setClsj(String clsj) {
		this.clsj = clsj;
	}

	public String getZgrs() {
		return zgrs;
	}

	public void setZgrs(String zgrs) {
		this.zgrs = zgrs;
	}

	public String getJycs() {
		return jycs;
	}

	public void setJycs(String jycs) {
		this.jycs = jycs;
	}

	public String getFrdb() {
		return frdb;
	}

	public void setFrdb(String frdb) {
		this.frdb = frdb;
	}

	public String getFrdbsfz() {
		return frdbsfz;
	}

	public void setFrdbsfz(String frdbsfz) {
		this.frdbsfz = frdbsfz;
	}

	public String getNxse() {
		return nxse;
	}

	public void setNxse(String nxse) {
		this.nxse = nxse;
	}

	public String getCvenfygl() {
		return cvenfygl;
	}

	public void setCvenfygl(String cvenfygl) {
		this.cvenfygl = "Y".equals(cvenfygl) ? "是"
				: ("N".equals(cvenfygl) ? "否" : cvenfygl);
	}

	private JSONArray apptitude;

	public JSONArray getApptitude() {
		return apptitude;
	}

	public void setApptitude(JSONArray apptitude) {
		this.apptitude = apptitude;
	}

	public String getBankaccountname() {
		return bankaccountname;
	}

	public void setBankaccountname(String bankaccountname) {
		this.bankaccountname = bankaccountname;
	}

	public String getBankcode() {
		return bankcode;
	}

	public void setBankcode(String bankcode) {
		this.bankcode = bankcode;
	}

	public String getBank() {
		return bank;
	}

	public void setBank(String bank) {
		this.bank = bank;
	}

	public String getBankaccount() {
		return bankaccount;
	}

	public void setBankaccount(String bankaccount) {
		this.bankaccount = bankaccount;
	}

	public String getCurrency() {
		return currency;
	}

	public void setCurrency(String currency) {
		this.currency = currency;
	}

	public String getcVenBankMemo() {
		return cVenBankMemo;
	}

	public void setcVenBankMemo(String cVenBankMemo) {
		this.cVenBankMemo = cVenBankMemo;
	}

	public JSONArray getPotentialSuppliers() {
		return potentialSuppliers;
	}

	public void setPotentialSuppliers(JSONArray potentialSuppliers) {
		this.potentialSuppliers = potentialSuppliers;
	}

	public JSONArray getQualifiedSuppliers() {
		return qualifiedSuppliers;
	}

	public void setQualifiedSuppliers(JSONArray qualifiedSuppliers) {
		this.qualifiedSuppliers = qualifiedSuppliers;
	}

	public String getPk_vendor() {
		return pk_vendor;
	}

	public void setPk_vendor(String pk_vendor) {
		this.pk_vendor = pk_vendor;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getBankAccount() {
		return bankAccount;
	}

	public void setBankAccount(String bankAccount) {
		this.bankAccount = bankAccount;
	}

	public String getCcontent() {
		return ccontent;
	}

	public void setCcontent(String ccontent) {
		this.ccontent = ccontent;
	}

	public String getCcuspaycond() {
		return ccuspaycond;
	}

	public void setCcuspaycond(String ccuspaycond) {
		this.ccuspaycond = ccuspaycond;
	}

	public String getCmoneytype() {
		return cmoneytype;
	}

	public void setCmoneytype(String cmoneytype) {
		this.cmoneytype = cmoneytype;
	}

	public String getCompanyType() {
		return companyType;
	}

	public void setCompanyType(String companyType) {
		this.companyType = companyType;
	}

	public String getCouttype() {
		return couttype;
	}

	public void setCouttype(String couttype) {
		this.couttype = couttype;
	}

	public String getCpurbillcode() {
		return cpurbillcode;
	}

	public void setCpurbillcode(String cpurbillcode) {
		this.cpurbillcode = cpurbillcode;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getLinkman() {
		return linkman;
	}

	public void setLinkman(String linkman) {
		this.linkman = linkman;
	}

	public String getPostCode() {
		return postCode;
	}

	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}

	public String getProperty() {
		return property;
	}

	public void setProperty(String property) {
		this.property = property;
	}

	public String getProviderCode() {
		return providerCode;
	}

	public void setProviderCode(String providerCode) {
		this.providerCode = providerCode;
	}

	public String getProviderName() {
		return providerName;
	}

	public void setProviderName(String providerName) {
		this.providerName = providerName;
	}

	public String getQualitySystem() {
		return qualitySystem;
	}

	public void setQualitySystem(String qualitySystem) {
		this.qualitySystem = qualitySystem;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public String getSimilarSuppliers() {
		return similarSuppliers;
	}

	public void setSimilarSuppliers(String similarSuppliers) {
		this.similarSuppliers = similarSuppliers;
	}

	public String getSupplyAddress() {
		return supplyAddress;
	}

	public void setSupplyAddress(String supplyAddress) {
		this.supplyAddress = supplyAddress;
	}

	public String getSupplyCycle() {
		return supplyCycle;
	}

	public void setSupplyCycle(String supplyCycle) {
		this.supplyCycle = supplyCycle;
	}

	public String getTaxRegister() {
		return taxRegister;
	}

	public void setTaxRegister(String taxRegister) {
		this.taxRegister = taxRegister;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String toJSON() {

		JSONObject jo = new JSONObject();

		try {
			Field[] fields = this.getClass().getDeclaredFields();

			if (fields != null) {
				try {
					for (int i = 0, length = fields.length; i < length; i++) {
						jo.put(fields[i].getName(), fields[i].get(this));
					}
				} catch (Exception e) {
					e.printStackTrace();
				}
			}

		} catch (Exception e) {
			e.printStackTrace();
		}

		return jo.toString();
	}

	public JSONObject toJSONObject() {

		JSONObject jo = new JSONObject();

		try {
			Field[] fields = this.getClass().getDeclaredFields();

			if (fields != null) {
				try {
					for (int i = 0, length = fields.length; i < length; i++) {
						jo.put(fields[i].getName(), fields[i].get(this));
					}
				} catch (Exception e) {
					e.printStackTrace();
				}
			}

		} catch (Exception e) {
			e.printStackTrace();
		}

		return jo;
	}

	public String getCvenbank() {
		return cvenbank;
	}

	public void setCvenbank(String cvenbank) {
		this.cvenbank = cvenbank;
	}

	public void addPotentialSuppliers(String nodeID) {
		if (this.potentialSuppliers == null) {
			this.potentialSuppliers = new JSONArray();
		}

		this.potentialSuppliers.put(nodeID);
	}

	public void addQualifiedSuppliers(String nodeID) {
		if (this.qualifiedSuppliers == null) {
			this.qualifiedSuppliers = new JSONArray();
		}

		this.qualifiedSuppliers.put(nodeID);
	}

	public JSONArray getStopSuppliers() {
		return stopSuppliers;
	}

	public void setStopSuppliers(JSONArray stopSuppliers) {
		this.stopSuppliers = stopSuppliers;
	}
	
	public static void main(String[] args) {
		List<String> list = new ArrayList<String>();
		list.add("121212");
		list.add("121, 212");
		
		System.out.println(list);
	}
}
